package com.gzj.environment.enums.code.impl.systemCode;

import com.gzj.environment.enums.code.BaseCode;
import lombok.AllArgsConstructor;

/**
 * @description:
 * @author: tsing
 * @create: 2020-08-09 14:58
 */
@AllArgsConstructor
public enum UserCode implements BaseCode {
    // 4.2.登录相关(4101~4199)
    INCORRECT_USERNAME_OR_PASSWORD(false, 4101, "用户名或密码有误"),
    INCORRECT_OLD_PASSWORD(false, 4102, "原密码有误"),
    TOO_MANY_RETRY_FOR_PASSWORD(false, 4103, "该账户密码重试次数过多已被锁定，一小时之内不能被登录"),
    ACCOUNT_HAS_BEEN_LOCKED(false, 4104, "该账户已被锁，请联系管理员"),
    NOT_LOG_IN(false, 4105, "您还未登录，或登录信息已过期"),

    EXISTS_USERNAME(false, 4106, "用户名已存在"),
    EXISTS_MOBILE(false, 4107, "手机号已存在"),

    ASSIGN_ROLE_FAILURE(false, 4108, "分配权限失败"),


    PASSWORD_RESET_FAILURE(false, 4109, "密码重置失败"),
    PASSWORD_EDIT_FAILURE(false, 4110, "密码修改失败"),
    PASSWORD_FORCE_EDIT_FAILURE(false, 4111, "强制修改密码失败"),
    ;

    private Boolean success; // 是否成功
    private int code; // 状态码
    private String message; // 操作信息

    @Override
    public boolean success() {
        return this.success;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String message() {
        return this.message;
    }
}
